package com.aaa.inside.feign;

import com.aaa.entity.base.Commodity;
import com.aaa.entity.base.Locator;
import com.aaa.entity.base.Warehouse;
import com.aaa.vo.R;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@FeignClient(value = "base-service")
public interface BaseFeign {

    /*通过货位编码和仓库id查询目标货位*/
    @GetMapping("/base/locator/selectTarLocByLoCode")
    @ApiOperation(value = "通过货位编码和仓库id查询目标货位")
    public Locator selectTarLocByLoCode(@RequestParam String locatorcode, @RequestParam Long warehouseid);

    /*通过仓库id查出当前仓库中所有的商品编码和名字*/
    @GetMapping("/base/commodity/selectComBarNamByWareId")
    @ApiOperation("通过仓库id查出当前仓库中所有的商品编码和名字")
    public List<Map> selectComBarNamByWareId(@RequestParam Long warehouseid);

    /*通过仓库id和商品编码查出该商品的名字和id*/
    @GetMapping("/base/commodity/selectComIdNamByWareIdCbar")
    public Commodity selectComIdNamByWareIdCbar(@RequestParam String commoditybar,@RequestParam Long warehouseid);

    @PostMapping("/base/locator/searchLocator/{page}/{limit}")
    @ApiOperation(value = "根据条件分页查询")
    public R searchLocator(@PathVariable Integer page,
                        @PathVariable Integer limit,
                        @RequestBody Locator locator,
                        @RequestParam Long warehouseid
    );
    @PostMapping("/base/warehouse/searchWare")
    public List<Warehouse> searchWare();
    @PostMapping("/base/warehouse/selectWareById")
    public Warehouse selectWareById(@RequestParam Long warehouseid);

    @PostMapping("/base/locator/selectIMoLo")
    public List<Map> selectIMoLo();

}
